<%-- 
    Document   : changeDeadlineSave
    Created on : 17.10.2010, 16:07:44
    Author     : nico
--%>

<%@page import="se.bth.ke.firstfriend.util.Util"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<% 
    request.setAttribute("TODO_DATE_FORMAT", Util.TODO_DEADLINE_FORMAT_STRING);
%>

<fmt:formatDate pattern="${TODO_DATE_FORMAT}" value="${it.deadline}" var="deadline" />

<p>${deadline != null ? 'New deadline saved' : 'Deadline removed'}</p>

<script type="text/javascript">
    $("#change-deadline-dialog").dialog({
        buttons: {
            Ok: function() {
                $(this).dialog("close");
            }
        }
    });

    $("#todo-${it.id}")
        .find(".deadline a")
        .text("${deadline != null ? 'Due ' : ''}${deadline != null ? deadline : 'No deadline set'}");
</script>